package com.qingmeng.project.service.impl.Inner;

import com.qingmeng.apicommon.service.InnerUserInterfaceInfoService;
import com.qingmeng.project.service.UserInterfaceInfoService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

@DubboService
public class InnerUserInterfaceInfoServiceImpl implements InnerUserInterfaceInfoService {
    @Resource
    private UserInterfaceInfoService userInterfaceInfoService;

    /**
     * 用户调用成功，接口调用次数加1
     * @param userId
     * @param interfaceId
     * @return
     */
    @Override
    public boolean invokeCountNum(long userId, long interfaceId) {
        if (userId <= 0 || interfaceId <= 0){
            throw new RuntimeException("参数错误");
        }
        return userInterfaceInfoService.invokeCountNum(userId, interfaceId);
    }
}
